package Tests;

import org.junit.Assert;
import org.junit.Test;

import Core.Map.Path;
import Core.Map.Tile;

public class PathTests {

	@Test
	public void testAddTileToEndOfPath()
	{
		Path path = new Path();
		
		Tile lastTile = new Tile(0, 0);
		
		path.addTileToEndOfPath(new Tile(0, 0)); // Doesn't matter, just need to add a tile before the expected final tile
		path.addTileToEndOfPath(lastTile);
		
		Assert.assertSame(lastTile, path.getLastTile());
	}

	@Test
	public void testInsertTile()
	{
		Path path = new Path();
		
		path.addTileToEndOfPath(new Tile(0, 0));
		path.addTileToEndOfPath(new Tile(0, 0));
		
		Tile insertedTile = new Tile(0, 0);
		
		path.insertTile(insertedTile, 2);
		
		Assert.assertEquals(insertedTile, path.getTileAtStep(2));
	}
}
